﻿
/****** Object:  User Defined Function dbo.IsDigits    Script Date: 10/14/2009 10:39:06 PM ******/

CREATE function IsDigits( @inString varchar(100) ) 
returns bit
as 
begin
	declare @i int
	declare @ret bit
	
	set @ret = 1
	set @i = 1
	while @i <= len( rtrim(@inString) )
	begin
		if substring( @inString, @i, 1 ) not between '0' and '9' 
		begin
			set @ret = 0
		end
		set @i = @i + 1
	end
	
	return @ret
end

